﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://wubiyu.cnblogs.com">
<head>
      <title></title>
      <link href="../../Theme/DomExtGray/gray.min.css" rel="Stylesheet" type="text/css" />
      <link href="PageModel.css" rel="Stylesheet" type="text/css" />
      <script type="text/javascript" src="../../domExt.min.js"></script>
</head>
<body>
      <div class="fun_title">
            _h.InitDom(context);
      </div>
      <div class="fun_content">
            描述：初始化context(dom对象)中的自定义HTML客户端标记<br />
       </div>
      <div class="fun_title2">
            参数:
      </div>
      <div class="fun_content2">
           context：dom对象<br />
      </div>
      <div class="fun_title2">
            示例:
      </div>
      <div class="code">
            &lt;div id=&quot;htmltemp&quot;&gt;&lt;/div&gt;
      </div>
      <input type="hidden" value="<div id='div1'><div class='testclass'>testdiv</div></div>"
            id="htmlcode">
      <div class="code">
            &lt;script type=&quot;text/javascript&quot;&gt;<br />
&nbsp;&nbsp;&nbsp; var str = &quot;&lt;h:btn onclick=&#39;alert(\&quot;test\&quot;)&#39;&gt;测试自定义HTML标记&lt;/h:btn&gt;&quot;;<br />
&nbsp;&nbsp;&nbsp; var htmltemp = _g(&quot;#htmltemp&quot;);
            <br />
&nbsp;&nbsp;&nbsp; htmltemp.innerHTML = str;
            <br />
&nbsp;&nbsp;&nbsp; _h.InitDom(htmltemp);<br />
            &lt;/script&gt;</div>
      <br />
      <h:btn onclick="run_click();">执行脚本</h:btn>
      <br />
       <br />
      <div id="htmltemp" ></div>
      <script type="text/javascript">
            function run_click() {
                  var str = "<h:btn onclick='alert(\"test\")'>测试自定义HTML标记</h:btn>";
                  var htmltemp = _g("#htmltemp");
                  htmltemp.innerHTML = str;
                  _h.InitDom(htmltemp);
            }
      </script>
</body>
</html>
